PROJECT(knewz)
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR )
FIND_PACKAGE( KDE4 REQUIRED )
INCLUDE( KDE4Defaults )
SET( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" )
ADD_SUBDIRECTORY( src )

#Package code
INCLUDE(InstallRequiredSystemLibraries)
SET( CPACK_PACKAGE_VENDOR "KNewz" )
SET( CPACK_PACKAGE_CONTACT "Lawrence Lee <valheru.ashen.shugar@gmail.com>" )
SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "Binary newsgroup program for KDE" )
SET( DEBIAN_PACKAGE_SECTION "Newsgroups" )
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
SET(CPACK_STRIP_FILES "bin/knewz")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_SET_DESTDIR ON)
SET( CMAKE_PACKAGE_VERSION "1.0.0" )
SET( CPACK_PACKAGE_VERSION_MAJOR "1" )
SET( CPACK_PACKAGE_VERSION_MINOR "0" )
SET( CPACK_PACKAGE_VERSION_PATCH "0" )
SET( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING" )
SET( CPACK_DEBIAN_PACKAGE_FILE_NAME "knewz-${CMAKE_PACKAGE_VERSION}_x86_64" )

IF( WIN32 AND NOT UNIX )
	SET( CPACK_PACKAGE_INSTALL_DIRECTORY "KNewz" )
	SET( CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/src/icons\\\\installer.bmp" )
	SET( CPACK_PACKAGE_UNICON "${CMAKE_SOURCE_DIR}/src/icons\\\\installer.bmp" )
	SET( CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\knewz.exe" )
	SET( CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/src/icons\\\\installer.ico" )
	SET(CPACK_CREATE_DESKTOP_LINK_KNewz ON)
	SET( CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} a binary newsgroup downloader" )
	SET( CPACK_NSIS_HELP_LINK "http:\\\\\\\\knewz.googlecode.com" )
	SET( CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.facticius.net" )
	SET( CPACK_NSIS_CONTACT "valheru.ashen.shugar@gmail.com" )
ELSE( WIN32 AND NOT UNIX )
	SET( CPACK_GENERATOR "DEB;RPM" )
	SET( CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64" )
	SET( CPACK_RPM_PACKAGE_DEPENDS "kdelib (>=4.2), qt (>=4.5)" )
	SET( CPACK_DEBIAN_PACKAGE_ARCHITECTURE "x86_64" )
	SET( CPACK_DEBIAN_PACKAGE_DEPENDS "kdelib (>=4.2), qt (>=4.5)" )
	SET( DEBIAN_PACKAGE_SECTION "Newsgroups" )
	SET( DEBIAN_PACKAGE_FILE_NAME "knewz-1.0.0_x86_64" )
	SET( CPACK_STRIP_FILES "bin/knewz" )
	SET( CPACK_SOURCE_STRIP_FILES "" )
	SET( CPACK_SET_DESTDIR ON )
ENDIF( WIN32 AND NOT UNIX )

SET ( CPACK_PACKAGE_EXECUTABLES "KNewz" "KNewz" )
INCLUDE( CPack )
